#include <iostream>
using namespace std;
int main(){
	int length;
	int *mang;
	cout << "Nhap vao so phan tu cua day so nguyen" << endl;
	cin >> length;
	mang = new int[length];
	for(int i= 0;i < length;i++){
		cout << "Nhap vao phan tu? thu' : " << i << endl;
		cin >> mang[i];
	}
	cout << "Day~ so' truoc' khi sap xep' : " << endl;
	for(int i= 0;i < length;i++){
		cout << mang[i] << "\t";
	}
	cout << endl;
	//Xap sep kieu? selection sort
	for(int i= 0;i < length;i++){
		for (int j=i+1;j< length;j++){
			if(mang[j] < mang[i]){
				int tam = mang[i];
				mang[i] = mang[j];
				mang[j] = tam;
			}
		}	
	}
	cout << "Mang sau khi xap sep : " << endl;
	for(int i= 0;i < length;i++){
		cout << mang[i] << "\t";
	}
	cout << endl;
}
